package com.hehao.java_basic.lambda;

/**
 * @Author Damon
 * @Date 2024/5/6 15:51
 */
public class FunctionDemo{
    void doSth(FunctionDemoA demo){
        System.out.println("demoA");
        demo.doSth();
    }

    void doSth(FunctionDemoB demo){
        System.out.println("demoB");
        demo.doSth();
    }

    public static void main(String[] args) {
        FunctionDemo functionDemo = new FunctionDemo();
        functionDemo.doSth((FunctionDemoB) ()->System.out.println("222"));
    }
}
